<%@ page language="java" import="java.text.*, java.util.*, com.zjut.zs.util.tools.*,com.zjut.zs.userinfo.manager.*, com.zjut.zs.userinfo.dao.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.exvalue.manager.*,com.zjut.zs.exvalue.dao.*,com.zjut.zs.cj.manager.*, com.zjut.zs.cj.dao.*,
com.zjut.an.util.tools.*,com.zjut.an.util.system.*,com.zjut.zs.xy.manager.*, com.zjut.zs.xy.dao.*,com.zjut.zs.zxlb.manager.*, com.zjut.zs.zxlb.dao.*,
com.zjut.zs.exvalue.dao.*,com.zjut.zs.coname.manager.*, com.zjut.zs.school.manager.*, com.zjut.zs.school.dao.*,com.zjut.zs.applyview.manager.*, com.zjut.zs.applyview.dao.*,
com.zjut.zs.shhd.manager.*, com.zjut.zs.shhd.dao.*,com.zjut.zs.hjqk.manager.*, com.zjut.zs.hjqk.dao.*,com.zjut.an.config.manager.*, com.zjut.an.config.dao.*,
com.zjut.zs.exampage.manager.*, com.zjut.zs.exampage.dao.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>无标题文档</title>

<link href="../apply/css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
h1 {
	font-size:32px;
	font-family: "Arial","Microsoft YaHei",sans-serif;
}
table.gridtable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}
table.gridtable td {
	border: 1px solid #666;
	padding: 6px;
}
table.toptable td {
	border: 1px solid #666;
	border-bottom:none;
	padding: 6px;
}
table.cj {table-layout: fixed;}
table.cj td {
	border: 1px solid #666;
	border-bottom:none;
	padding: 6px;
}
-->
</style>
<script type="text/javascript" src="../apply/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
function printHtml(html) {
	var bodyHtml = document.body.innerHTML;
	document.body.innerHTML = html;
	window.print();
	document.body.innerHTML = bodyHtml;
}
function onprint() {
	var html = $("#container").html();
	printHtml(html);
}
</script>

</head>
<%	
AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
ZsSchoolManager zsManager = (ZsSchoolManager) SpringContextUtil.getBean("ZsSchoolManager");
ZsCoNameManager comanager = (ZsCoNameManager) SpringContextUtil.getBean("ZsCoNameManager");
ZsExValueManager evmanager = (ZsExValueManager) SpringContextUtil.getBean("ZsExValueManager");
ZsUserinfoManager uimanager = (ZsUserinfoManager) SpringContextUtil.getBean("ZsUserinfoManager");
ZsZxlbManager zmanager = (ZsZxlbManager) SpringContextUtil.getBean("ZsZxlbManager");
ZsShhdManager smanager = (ZsShhdManager) SpringContextUtil.getBean("ZsShhdManager");
ZsHjqkManager hmanager = (ZsHjqkManager) SpringContextUtil.getBean("ZsHjqkManager");
ZsCjManager cmanager = (ZsCjManager) SpringContextUtil.getBean("ZsCjManager");
ZsXyManager xmanager = (ZsXyManager) SpringContextUtil.getBean("ZsXyManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
ZsExamPageManager epmanager = (ZsExamPageManager) SpringContextUtil.getBean("ZsExamPageManager");
ZsHTMLCreat html = (ZsHTMLCreat) SpringContextUtil.getBean("ZsHTMLCreat");


System.out.println(request.getParameter("rowstr"));
List<ZsApplyView> list = JSONUtilClassTime.getDTOList(request.getParameter("rowstr"), ZsApplyView.class);
System.out.println("###############"+list.size());


ZsSchool school = new ZsSchool();
school = (ZsSchool)zsManager.getDataByInstance(1,1,null,null,school).getObjects().get(0);
ZsExamPage exampage = new ZsExamPage();


%>
<body>
	<div class="place" style="margin-top:0;">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">准考证打印</a></li>
    </ul>
    </div>
    <input type="button" onclick="onprint()" value="打印" class="btn btn-primary btn-sm" style="margin:20px;"/>
    <div id="container" class="container" style="width:100%;">
    
<%
for (int i=0; i<list.size(); i++) {
	%>
	<div style="page-break-after:always;">
	<%
	ZsUser user = null;
	ZsExValue exValue = new ZsExValue();
	ZsUserinfo userinfo = new ZsUserinfo();
	ZsCj cj = new ZsCj();
	ZsXy xy = new ZsXy();
	ZsZxlb zxlb = new ZsZxlb();
	ZsShhd shhd = new ZsShhd();
	ZsHjqk hjqk = new ZsHjqk();
	
	ZsApplyView appview=(ZsApplyView)list.get(i);
	//String receiveno = html.getReceiveNo(appview.getUsNo());
	exampage = epmanager.getData(appview.getExId());
	System.out.println("!!###############"+(appview.getExId()));
	System.out.println("!###############"+(exampage.getExId()));
    if (null!=exampage.getExId()) {
    	String content = exampage.getExContent().replace("$usName$", appview.getUsName())
    			.replace("$usIdcard$", html.getInputString(appview.getUsIdcard()))
    	    	.replace("$usEmail$", html.getInputString(appview.getUsEmail()))
    	    	.replace("$usMobile$", html.getInputString(appview.getUsMobile()))
    	    	.replace("$testNo$", html.getInputString(appview.getTestNo()))
    	    	.replace("$column1$", html.getInputString(appview.getColumn1()))
    	    	.replace("$column2$", html.getInputString(appview.getColumn2()))
    	    	.replace("$column3$", html.getInputString(appview.getColumn3()))
    	    	.replace("$column4$", html.getInputString(appview.getColumn4()))
    	    	.replace("$column5$", html.getInputString(appview.getColumn5()))
    	    	.replace("$column6$", html.getInputString(appview.getColumn6()))
    	    	.replace("$column7$", html.getInputString(appview.getColumn7()))
    	    	.replace("$column8$", html.getInputString(appview.getColumn8()))
    	    	.replace("$column9$", html.getInputString(appview.getColumn9()))
    	    	.replace("$column10$", html.getInputString(appview.getColumn10()))
    	    	.replace("$inZydm01$", html.getInputString(appview.getInZydm01()))
    	    	.replace("$inZydm02$", html.getInputString(appview.getInZydm02()))
    	    	.replace("$inZydm03$", html.getInputString(appview.getInZydm03()))
    	    	.replace("$inZydm04$", html.getInputString(appview.getInZydm04()))
    	    	.replace("$inZydm05$", html.getInputString(appview.getInZydm05()))
    	    	.replace("$inZydm06$", html.getInputString(appview.getInZydm06()))
    	    	.replace("$inZydm07$", html.getInputString(appview.getInZydm07()))
    	    	.replace("$inZydm08$", html.getInputString(appview.getInZydm08()))
    	    	.replace("$inZydm09$", html.getInputString(appview.getInZydm09()))
    	    	.replace("$inZydm10$", html.getInputString(appview.getInZydm10()))
    	    	.replace("$inZymc01$", html.getInputString(appview.getInZymc01()))
    	    	.replace("$inZymc02$", html.getInputString(appview.getInZymc02()))
    	    	.replace("$inZymc03$", html.getInputString(appview.getInZymc03()))
    	    	.replace("$inZymc04$", html.getInputString(appview.getInZymc04()))
    	    	.replace("$inZymc05$", html.getInputString(appview.getInZymc05()))
    	    	.replace("$inZymc06$", html.getInputString(appview.getInZymc06()))
    	    	.replace("$inZymc07$", html.getInputString(appview.getInZymc07()))
    	    	.replace("$inZymc08$", html.getInputString(appview.getInZymc08()))
    	    	.replace("$inZymc09$", html.getInputString(appview.getInZymc09()))
    	    	.replace("$inZymc10$", html.getInputString(appview.getInZymc10()))
    	    	.replace("$scColumn1$", html.getInputString(appview.getScColumn1()))
    	    	.replace("$scColumn2$", html.getInputString(appview.getScColumn2()))
    	    	.replace("$scColumn3$", html.getInputString(appview.getScColumn3()))
    	    	.replace("$scColumn4$", html.getInputString(appview.getScColumn4()))
    	    	.replace("$scColumn5$", html.getInputString(appview.getScColumn5()))
    	    	.replace("$scColumn6$", html.getInputString(appview.getScColumn6()))
    	    	.replace("$scColumn7$", html.getInputString(appview.getScColumn7()))
    	    	.replace("$scColumn8$", html.getInputString(appview.getScColumn8()))
    	    	.replace("$scColumn9$", html.getInputString(appview.getScColumn9()))
    	    	.replace("$scColumn10$", html.getInputString(appview.getScColumn10()))
    	    	.replace("$inXb$", html.getInputString(appview.getInXb()))
    	    	.replace("$inMz$", html.getInputString(appview.getInMz()))
    	    	.replace("$inZzmm$", html.getInputString(appview.getInZzmm()))
    	    	.replace("$usBmxh$", html.getInputString(appview.getUsBmxh())) 
    	    	.replace("$inKslb$", html.getInputString(appview.getInKslb()))
    	    	.replace("$inLxdh$", html.getInputString(appview.getInLxdh()))
    	    	.replace("$inLxdh2$", html.getInputString(appview.getInLxdh2()))
    	    	.replace("$inByxxmc$", html.getInputString(appview.getInByxxmc()))
    	    	.replace("$testNoOrder$", html.getInputString(appview.getInPinying()))
    	    	.replace("$receiveno$", user.getUsNo());
    	    	content = content.replace("src=\"inPhoto\"", "src='../photo/"+html.getInputString(user.getUsIdcard())+".jpg' ");  
	    out.print(content);
    }
    %>
<script>
$("#ewcode1").attr("src","https://sapi.k780.com/?app=qr.get&data=<%=anconfig.getSingleConfigInfoByName("网站域名") %>/admin/zsApplyViewStatus.jsp?usId=<%=user.getUsId()%>&level=L&size=6&localStatusType=single"); 
$("#ewcode2").attr("src","https://sapi.k780.com/?app=qr.get&data=<%=anconfig.getSingleConfigInfoByName("网站域名") %>/admin/zsApplyViewEdit.jsp?usId=<%=user.getUsId()%>&level=L&size=6"); 
</script>
</div>
<%
} %>

   </div>
</body>
</html>
